Author |
|
tdkappa
Joined: 15 Feb 2017 Posts: 8
|
Posted: Wed 15 Feb '17 13:22 Post subject: implement Wordpress htaccess |
|
|
Hello to evryone, and first of all sorry for my english!
I'm testing my Wordpress website in a localhost webserver
http://localhost/mywordpress/
the file .htaccess it's like below:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngineOn
RewriteBase/mywordpress/
RewriteRule^index\.php$ -[L]
RewriteCond%{REQUEST_FILENAME}!-f
RewriteCond%{REQUEST_FILENAME}!-d
RewriteRule./mywordpress/index.php [L]
</IfModule>
# END WordPress
I would like to can resolve this address:
http://localhost/mywordpress/1/otherdb/
like this:
http://localhost/mywordpress/news.php?id_news=1
if I comment htaccess rules create by wordpress, it works
RewriteRule^mywordpress/([0-9]+)/([a-zA-Z0-9-]+)/$ mywordpress/news.php?id_news=$1
but with hataccess wordpress don't works.
How can I chenge the rules ?
Thank You for help ! |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Wed 15 Feb '17 15:57 Post subject: |
|
|
Don't change the htaccess file and the rewrite rules.
You can change it at /wp-admin/options-permalink.php
Example
Code: | /archives/%category%/%postname%-%post_id%/ |
or in your case maybe
Code: | /%category%/%postname%/ |
For sure the category can be news |
|
Back to top |
|
tdkappa
Joined: 15 Feb 2017 Posts: 8
|
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Tue 14 Mar '17 11:56 Post subject: |
|
|
The [L] in wordpress says that it is the last rule. So you need to put your new rule over the wordpress rule to get it applied. |
|
Back to top |
|
tdkappa
Joined: 15 Feb 2017 Posts: 8
|
Posted: Tue 14 Mar '17 17:52 Post subject: |
|
|
James Blond wrote: | The [L] in wordpress says that it is the last rule. So you need to put your new rule over the wordpress rule to get it applied. |
thank you so much! tonight I try your solution and I write you the results! |
|
Back to top |
|