What if you do this:
Code:RewriteEngine On RewriteBase /foldername/ RewriteRule ^([^/]*)$ /foldername/site.php?link=$1 [L]
Hey people,
Im currently adding a mod rewite to my hta_access file and put in the following code, for some reason it wont work...
RewriteEngine On
RewriteRule ^([^/]*)$ /foldername/site.php?link=$1 [L]
Foldername is the name of my folder and site.php is the name of the php file which connects to the database and displays the page.
The url should change from :
sitename.co.uk/foldername/site.php?databaselink=whatever
to :
sitename.co.uk/whatever
But for some reason won't work..
Any ideas?![]()
What if you do this:
Code:RewriteEngine On RewriteBase /foldername/ RewriteRule ^([^/]*)$ /foldername/site.php?link=$1 [L]
Hey there, ive just tried as suggested , but still no luck..
Ok this is my current htaccess data : (slightly edited ofcourse, for names of folders etc)
# BEGIN WordPress
# Link Cloaker Plugin BEGIN
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^link/([^/]*)/([0-9]+)/([0-9]+)/?$ http://www.sitename.co.uk/wordpress/wp-content/plugins/link-cloaking-plugin/wplc_redirector.php?post_id=$2&link_num=$3&cloaked _url=$0 [L]
RewriteRule ^link/([^/]+)[/]?$ http://www.sitename.co.uk/wordpress/wp-content/plugins/link-cloaking-plugin/wplc_redirector.php?name=$1&cloaked_url=$0 [L]
</IfModule>
# Link Cloaker Plugin ENDS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
RewriteCond %{HTTP_HOST} !^www\.sitename\.co.uk$
RewriteRule (.*) http://www.sitename.co.uk/$1 [R=301,L]
RewriteEngine On
RewriteRule ^([^/]*)\.php$ /foldername/site.php?link=$1 [L]
Now, the site redirects properly non www to a www site fine, and the links are masked as well, its just the last statement which wont work, trying to create better structured permalinks from a database php.
Im sure its something obvious,but just cant seem to work it out...![]()
I must admit this stuff always makes me scratch my head!
Could you try this, go into your foldername directory create a new htaccess file and put the following:
It won't get rid of the foldername folder for now, i just want to test that you can get to the link like : www.sitename.co.uk/foldername/$1Code:RewriteEngine on RewriteBase /foldername/ RewriteRule ^([^/]*)$ site.php?link=$1 [L]
Ok..ive been looking into things and may have found the problem, just need the solution now!
Basically, the site im writing the htacess for is an add on domain, so presumable i need the rewrite base or something to by pass the main site and treat this add on site as seperate..the question is how!?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks